<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
  <TITLE>tracetcp</TITLE>
  <LINK REV="made" HREF="mailto:">
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
  <META NAME="generator" CONTENT="NoteTab Light 4.95">
  <META NAME="author" CONTENT="">
  <META NAME="description" CONTENT="">
  <META NAME="keywords" CONTENT="">
</HEAD>

<BODY BGCOLOR="#000050" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<TABLE ALIGN="center" BGCOLOR="#909090" BORDER="0" CELLSPACING="10" CELLPADDING="5" WIDTH="100%">
  <TR ALIGN="center" VALIGN="middle">
    <TD ALIGN="left" VALIGN="top" WIDTH = "200" BGCOLOR="#e0e0f0">
      <!-- Sets up an IFRAME that conatins the common menu for the whole site. -->
	<IFRAME SRC="tracetcp_menu.html" ALIGN="top" WIDTH = "200" HEIGHT = "600" FRAMEBORDER="0"></IFRAME>
    </TD>

    <TD ALIGN="left" VALIGN="top" BGCOLOR="#e0e0f0">
      <h3>Scan for Blocked Outgoing Ports</h3>
<!-- Descriptive text. -->

<p>
While it is useful to see that a port is being blocked:
</p>

<!-- end Descriptive text. -->


<!-- Program output. -->
<TABLE ALIGN="center" BORDER="1" CELLSPACING="0" CELLPADDING="5" WIDTH="95%" BGCOLOR="#ffffff" >
  <TR>
   <TD>
    <PRE>$ tracetcp www.ebay.co.uk:135

Tracing route to 66.135.192.41 [www.ebay.co.uk] on port 135
Over a maximum of 30 hops.
1       1 ms    1 ms    1 ms    192.168.0.1     [wintermute]
2       10 ms   13 ms   9 ms    10.78.128.1
3       *       *       *       Request timed out.
4       *       *       *       Request timed out.
5       *       *       *       Request timed out.
6 ... continues until maximum number of hops reached.</PRE>
   </TD>
  </TR>
</TABLE>
<!-- End Program output. -->

<p>
<b>tracetcp</b> can be used to scan a range of ports to find which are blocked and which are not. The command line seems a little complex so I'll go though them all. We are scanning the range of ports 130-140 (-r 130 140). To speed things up the timeout is set to 0.5 seconds (-t 500). Condensed output mode is enabled (-c) or we will get screens full of output. Reverse DNS lookups are disabled (-n). Each packet we send has a TTL set to 3 (-h 3), is only sent for 1 hop (-m 1), and only 1 packet is sent per hop (-p). 
</p>

<p>
Note that it doesn't really matter what host is used for the trace as none of the packets will ever reach it as they will all expire before reaching the host. 
</p>

<!-- Program output. -->
<TABLE ALIGN="center" BORDER="1" CELLSPACING="0" CELLPADDING="5" WIDTH="95%" BGCOLOR="#ffffff" >
  <TR>
   <TD>
    <PRE>$ tracetcp www.ebay.co.uk -h 3 -m 1 -p 1 -t 500 -c -r 130 140 -n
[66.135.192.41:130]  3  11 ms   62.30.193.33
[66.135.192.41:131]  3  11 ms   62.30.193.33
[66.135.192.41:132]  3  10 ms   62.30.193.33
[66.135.192.41:133]  3  10 ms   62.30.193.33
[66.135.192.41:134]  3  13 ms   62.30.193.33
[66.135.192.41:135]  3  *       Request timed out.
[66.135.192.41:136]  3  10 ms   62.30.193.33
[66.135.192.41:137]  3  *       Request timed out.
[66.135.192.41:138]  3  *       Request timed out.
[66.135.192.41:139]  3  *       Request timed out.
[66.135.192.41:140]  3  11 ms   62.30.193.33</PRE>
   </TD>
  </TR>
</TABLE>

<p>
By changing the command line slightly we can trace from hop 1 to 3 for each port (-h 1 -m 3) so as to determine at which hop the ports are blocked. Port 135 is block by my ISPs router at hop 2, and ports 137, 138, 139 are blocked by my own router at hop 1.
</p>

<TABLE ALIGN="center" BORDER="1" CELLSPACING="0" CELLPADDING="5" WIDTH="95%" BGCOLOR="#ffffff" >
  <TR>
   <TD>
    <PRE>$ tracetcp www.ebay.co.uk -h 1 -m 3 -p 1 -t 500 -c -r 134 140 -n
[66.135.208.41:134]  1  1 ms    192.168.0.1
[66.135.208.41:134]  2  12 ms   10.78.128.1
[66.135.208.41:134]  3  10 ms   62.30.193.33

[66.135.208.41:135]  1  1 ms    192.168.0.1
[66.135.208.41:135]  2  10 ms   10.78.128.1
[66.135.208.41:135]  3  *       Request timed out.

[66.135.208.41:136]  1  1 ms    192.168.0.1
[66.135.208.41:136]  2  11 ms   10.78.128.1
[66.135.208.41:136]  3  9 ms    62.30.193.33

[66.135.208.41:137]  1  1 ms    192.168.0.1
[66.135.208.41:137]  2  *       Request timed out.
[66.135.208.41:137]  3  *       Request timed out.

[66.135.208.41:138]  1  1 ms    192.168.0.1
[66.135.208.41:138]  2  *       Request timed out.
[66.135.208.41:138]  3  *       Request timed out.

[66.135.208.41:139]  1  1 ms    192.168.0.1
[66.135.208.41:139]  2  *       Request timed out.
[66.135.208.41:139]  3  *       Request timed out.

[66.135.208.41:140]  1  1 ms    192.168.0.1
[66.135.208.41:140]  2  12 ms   10.78.128.1
[66.135.208.41:140]  3  187 ms  62.30.193.33</PRE>
   </TD>
  </TR>
</TABLE>


  </TD>
 </TR>
</TABLE>
</BODY>
</HTML>
